package com.hua.designpattern.j2eepattern.filterinterceptor;

public class FilterAuthorization implements FilterInterface {

	private String keyword;

	@Override
	public void init(String congfig) {
		this.keyword = congfig;
	}

	@Override
	public void doFilter(String request, String response, FilterChain filterChain) {
		if (request.contains(keyword)) {
			System.out.println("through the validation, can do next:" + keyword);
			filterChain.doFilter(request, response);
		} else {
			System.out.println("not through the validation, can not do next:" + keyword);
		}
	}

	@Override
	public void destroy() {
		keyword = null;
	}

}
